#ifndef NET_TIMERMANAGER_H_
#define NET_TIMERMANAGER_H_

#include "itick.h"
#include "itimermanager.h"

namespace net {

class Timer;
class EpollReactor;

class TimerManager : public ITick, public ITimerManager {
public:
    TimerManager(EpollReactor* reactor);
    virtual ~TimerManager();

public:
    void AddTimer(Timer* timer);
    void RemoveTimer(Timer* timer);

    void OnTimer(Timer* timer);

private:
    virtual uint32_t GetTick();
    virtual void OnTick();

private:
    virtual ITimer* CreateTimer();

private:
    EpollReactor* reactor_;
};

}

#endif
